def selection(arr):
    for i in range(0, len(arr)):
        a = i       # 依次拿取一个值下标
        for j in range(i+1, len(arr)):
            if arr[j] < arr[a]:
                a = j      # 将最小值的下标记录
        arr[i], arr[a] = arr[a], arr[i]    # 将最小值与拿的值换位
    return arr


l = selection([5, 2, 8, 7, 9, 1, 6, 4, 3, 0])
print(l)
